<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>vw vh test</title>
  <style>
  body {
    margin: 0;
    padding: 0;
  }

  #container {
    background-color: red;
    width: 10vw;
    height: 10vh;
  }
  </style>
</head>
<body>
<p>vw vh 测试</p>
<div id="container">
</div>

<script>
// window.innerHeight === 100vh
// window.innerWidth === 100vw
</script>
</body>
</html>
